<template>
    <div class="epmListContainer">
        <!--器材分类-->
        <template v-for="item in this.list">
            <!--分类盒子-->
            <div class="type">
                <!--标题部分-->
                <div class="title" v-text="item.name"></div>
                <!--设备部分-->
                <div
                    v-if="item.children.length>0"
                    class="eqmList"
                >
                    <div
                        v-for="key in item.children"
                        :key="key.id"
                        class="equipment"
                        @click="sendName(key.name)"
                    >
                        <img :alt="key.name" :src="key.img" :title="key.name">
                        <div class="name" v-text="key.name"></div>
                    </div>
                </div>
            </div>
        </template>
    </div>
</template>
<script>
export default {
    name: 'equipmentList',
    data() {
        return {};
    },
    props: {
        list: {
            type: Array,
            default: () => {
                return [];
            }
        }
    },
    methods: {
        //传递点击设备的名字
        sendName(name) {
            this.$emit('func', name);
        }
    }
};
</script>
<style lang="less" scoped src="../style/equipmentList.less">
</style>
